#!/bin/sh -e

CHPST="chpst -u postgres"
if ! $CHPST true 2> /dev/null; then
    CHPST=""
fi

exec 2>&1
exec $CHPST env -i /usr/sbin/pgbouncer /run/pgbouncer/pgbouncer.ini
